﻿@using App.MVC.App_Start

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link rel="stylesheet" href="~/Template/ace_admin_v1.4.0/components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css" />
<script src="~/Template/ace_admin_v1.4.0/components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js"></script>
<script src="~/Template/ace_admin_v1.4.0/components/moment/moment.js"></script>
<script src="~/Template/ace_admin_v1.4.0/assets/js/src/ace.searchbox-autocomplete.js"></script>
<div id="app" class="row">
    <div class="col-lg-12">
        <div class="row" id="list">
            <div class="col-lg-12">
                <p>
                    <button class="btn btn-white btn-info btn-bold" v-on:click="p_OpenModal">
                        <i class="ace-icon glyphicon glyphicon-plus bigger-120 blue"></i>
                        新增工作计划
                    </button>
                </p>
                <table id="dynamic-table" class="table table-striped table-bordered table-hover">
                    <thead>
                        <tr>
                            <th class="center">
                                名称
                            </th>
                            <th>创建时间</th>
                            <th>所属时间</th>
                            <th>状态</th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr v-for="tr in khblst">
                            <td class="center">
                                {{tr.mkhbmc}}
                            </td>
                            <td>
                                {{tr.cjsjstr}}
                            </td>
                            <td>
                                {{tr.sssjstr}}
                            </td>
                            <td>
                                <template v-if="tr.khbzt==1">
                                    创建完成
                                </template>
                                <template v-if="tr.khbzt==2">
                                    编辑中
                                </template>
                                <template v-if="tr.khbzt==3">
                                    提交审核
                                </template>
                                <template v-if="tr.khbzt==4">
                                    通过审核
                                </template>
                            </td>
                            <td>

                                <div class="btn-group" v-if="tr.khbzt==2||tr.khbzt==1">
                                    <button data-toggle="dropdown" class="btn btn-primary btn-white dropdown-toggle btn-sm">
                                        操作
                                        <i class="ace-icon fa fa-angle-down icon-on-right"></i>
                                    </button>

                                    <ul class="dropdown-menu">
                                        <li>
                                            <a href="#" v-on:click="p_Edit(tr)">编辑</a>
                                        </li>
                                        <li>
                                            <a href="#" v-on:click="p_TiJiaoShenHe(tr.mkhbid)">提交</a>
                                        </li>
                                        <li>
                                            <a href="#" v-on:click="p_Del(tr.mkhbid)">删除</a>
                                        </li>
                                    </ul>
                                </div><!-- /.btn-group -->
                            </td>

                        </tr>

                    </tbody>
                </table>
            </div>
        </div>

        <div class="row" id="info" style="display: none">
            <div class="col-xs-12  widget-container-col">
                <!-- #section:custom/widget-box -->
                <div class="widget-box">
                    <div class="widget-header">
                        <h5 class="widget-title">编辑区</h5>

                        <!-- #section:custom/widget-box.toolbar -->
                        <div class="widget-toolbar">
                            <div class="widget-menu">
                                <a href="#" data-action="settings" data-toggle="dropdown">
                                    <i class="ace-icon fa fa-bars"></i>
                                </a>

                                <ul class="dropdown-menu dropdown-menu-right dropdown-light-blue dropdown-caret dropdown-closer">
                                    <li>
                                        <a data-toggle="tab" href="#dropdown1" v-on:click="ShowList()">返回列表</a>
                                    </li>

                                </ul>
                            </div>


                        </div>

                        <!-- /section:custom/widget-box.toolbar -->
                    </div>

                    <div class="widget-body">
                        <div class="widget-main">
                            <div class="form-horizontal" role="form">
                                <div class="row">
                                    <div class="col-xs-5">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                工作计划名称：
                                            </span>
                                            <input type="text" class="form-control search-query" placeholder="工作计划名称" readonly="readonly" v-bind:value="khbinfo.mkhbmc" />

                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <table class="table  table-bordered table-hover">
                                        <thead class="thin-border-bottom">
                                            <tr>
                                                <th>
                                                    名称
                                                </th>
                                                <th>分值</th>
                                            </tr>
                                        </thead>

                                        <tbody>
                                            <template v-for="tr in khbinfo.MyKaoHeBiaoOnes">
                                                <tr>
                                                    <td>
                                                        {{tr.mbnr}}
                                                    </td>

                                                    <td>
                                                        {{tr.fz}}
                                                    </td>
                                                </tr>
                                                <tr class="detail-row open">
                                                    <td colspan="2">
                                                        <div class="table-detail">
                                                            <div class="row">
                                                                <div class="col-xs-12">
                                                                    <p>
                                                                        <span class="label label-xlg label-primary arrowed arrowed-right">包含子项</span>
                                                                        <template v-if="tr.isedit">
                                                                            <button class="btn btn-white btn-success btn-bold" type="button" v-on:click="p_AddTwo(tr)">
                                                                                <i class="ace-icon glyphicon glyphicon-plus bigger-120 orange"></i>
                                                                                新增子项
                                                                            </button>
                                                                        </template>
                                                                    </p>
                                                                    <table class="table table-striped table-bordered table-hover no-margin-bottom no-border-top">
                                                                        <thead>
                                                                            <tr>
                                                                                <th style="width: 350px">工作计划</th>
                                                                                <th style="width: 150px">预计完成时间</th>
                                                                                <th style="width: 150px">工作承担人</th>
                                                                                <th style="width: 100px">分值</th>
                                                                                <th style="width: 100px">操作</th>
                                                                            </tr>
                                                                        </thead>
                                                                        <tbody>
                                                                            <tr v-for="son in tr.MyKaoHeBiaoTwos">
                                                                                <template v-if="son.IsEdit">
                                                                                    <td>
                                                                                        {{son.mbnr}}
                                                                                    </td>
                                                                                    <td>
                                                                                        <div class="input-group">
                                                                                            @*<input class="form-control input-mask-date" type="text" v-model="son.gzjhkssjstr" v-on:click="inputdatetimeformat($event)" @@focus="inputdatetimeformat($event)" @@keyup="dateformat($event,son)" />*@

                                                                                            {{son.gzjhwcsj}}
                                                                                        </div>
                                                                                    </td>
                                                                                    <td>{{son.gzcdr}}</td>
                                                                                    <td>
                                                                                        <template v-if="tr.fz>=0">
                                                                                            {{son.fz}}
                                                                                        </template>

                                                                                    </td>
                                                                                    <td>
                                                                                        <div class="btn-group">
                                                                                            <button class="btn btn-info btn-white" v-on:click="p_EditTwo(tr,son)">编辑</button>

                                                                                            <button data-toggle="dropdown" class="btn btn-info btn-white dropdown-toggle">
                                                                                                <span class="ace-icon fa fa-caret-down icon-only"></span>
                                                                                            </button>

                                                                                            <ul class="dropdown-menu dropdown-info dropdown-menu-right">
                                                                                                <li>
                                                                                                    <a href="javascript:void(0)" v-on:click="p_AddTwo(tr,son)">添加子工作</a>
                                                                                                </li>


                                                                                                <template v-if="son.lyid==4">
                                                                                                    <li class="divider"></li>

                                                                                                    <li>
                                                                                                        <a href="#" v-on:click="p_DelTwo(tr,son)">删除</a>
                                                                                                    </li>
                                                                                                </template>
                                                                                            </ul>
                                                                                        </div><!-- /.btn-group -->
                                                                                    </td>
                                                                                </template>
                                                                                <template v-if="!son.IsEdit">
                                                                                    <td>
                                                                                        {{son.mbnr}}
                                                                                    </td>
                                                                                    <td>
                                                                                        <div class="input-group">
                                                                                            {{son.gzjhwcsj}}
                                                                                            @*{{son.gzjhwcsj}}*@
                                                                                            @*<input class="form-control" placeholder="预计完成时间" v-model="son.gzjhwcsjstr" style="width: 150px"/>*@

                                                                                        </div>
                                                                                    </td>
                                                                                    <td>{{son.gzcdr}}</td>
                                                                                    <td>
                                                                                        {{son.fz}}
                                                                                    </td>
                                                                                    <td></td>
                                                                                </template>
                                                                            </tr>
                                                                        </tbody>
                                                                    </table>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </template>
                                        </tbody>
                                    </table>
                                </div>
                                @*<div class="clearfix form-actions">
                                        <div class="col-md-offset-1 col-md-11">
                                            <button class="btn btn-white btn-info btn-bold" type="button" v-on:click="p_Save()">
                                                <i class="ace-icon fa fa-floppy-o bigger-120 blue"></i>
                                                保存
                                            </button>


                                        </div>
                                    </div>*@
                            </div>
                        </div>
                    </div>
                </div>

                <!-- /section:custom/widget-box -->
            </div>

            <!-- /.span -->
        </div><!-- /.row -->
        <!--弹出框-->
        <div class="row">
            <div class="col-xs-12">
                <div id="dialog-message" class="hide">
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="form-horizontal" role="form">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right" data-rel="tooltip" title="哪个月的工作计划"> 所属时间 </label>
                                    <div class="col-sm-9">
                                        <div class="input-group">
                                            <input class="form-control date-picker" readonly="readonly" type="text" data-date-format="yyyy-mm" id="sssj" />
                                            <span class="input-group-addon">
                                                <i class="fa fa-calendar bigger-110"></i>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div><!-- #dialog-message -->
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <div id="editmessage" class="hide">
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="form-horizontal" role="form">

                                <form class="form-horizontal" role="form">
                                    <div class="row">
                                        <div class="col-xs-8">
                                            <div class="form-group">
                                                <div>
                                                    <label for="form-field-8">工作内容</label>

                                                    <textarea class="form-control" id="form-field-8"
                                                              placeholder="工作内容" rows="3" v-model="khnrtow.mbnr"></textarea>

                                                    <template v-else>
                                                        {{khnrtow.mbnr}}
                                                    </template>
                                                </div>
                                            </div>
                                            <div class="hr hr-24"></div>
                                            <div class="form-group">
                                                <div>
                                                    <label for="form-field-1" data-rel="tooltip" title="完成时填写，未完成可不填写">完成情况</label>

                                                    <textarea class="form-control" id="form-field-1"
                                                              placeholder="完成情况" v-model="khnrtow.gzjhwcqk"></textarea>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-xs-4">
                                            <div class="alert alert-info">
                                                <div class="form-group">
                                                    <div>
                                                        <label for="form-field-select-1">工作承担人</label>
                                                        <input id="tags" type="text" class="form-control" />
                                                        @*<select class="form-control" id="form-field-select-1" @@change="getgzcdr">
                                                                <option :value="coupon.userinfoId" v-for="coupon in gzcdrlist">{{coupon.XingMing}}</option>
                                                            </select>*@
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label for="date-picker2">计划完成时间</label>

                                                    <div class="row">
                                                        <div class="col-xs-8 col-sm-11">
                                                            <!-- #section:plugins/date-time.datepicker -->
                                                            <div class="input-group">
                                                                <input class="form-control date-picker2"
                                                                       id="date-picker2" type="text"
                                                                       data-date-format="yyyy-mm-dd" readonly="readonly" />
                                                                <span class="input-group-addon">
                                                                    <i class="fa fa-calendar bigger-110"></i>
                                                                </span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label for="form-field-2">分值</label>

                                                    <div>
                                                        <input type="text" id="form-field-2" placeholder="分值"
                                                               class="col-xs-10 col-sm-5" v-model="khnrtow.fz" />
                                                    </div>
                                                </div>
                                                @*<div class="form-group">
                                                        <div>
                                                            <label>重要程度</label>

                                                            <select class="form-control" v-model="khnrtow.zycd">
                                                                <option value="1">重要</option>
                                                                <option value="2">一般</option>
                                                                <option value="3">不重要</option>
                                                            </select>
                                                        </div>
                                                    </div>*@
                                            </div>
                                        </div>
                                    </div>
                                    <!-- #section:elements.form -->
                                </form>
                            </div>
                        </div>
                    </div>
                </div><!-- #dialog-message -->
            </div>
        </div>
        @*<div class="input-group">
                <input class="form-control input-mask-date" type="text"/>
            </div>*@
    </div>
</div>
<script src="~/Template/ace_admin_v1.4.0/components/jquery.maskedinput/src/jquery.maskedinput.js"></script>
<script src="~/Scripts/JsModel/Model_KaoHeBiao.js"></script>
<script src="~/Scripts/JsModel/Model_JiaoZhiGong.js"></script>
<script type="text/javascript">
    //$(document).ready(function () {
    //    $('.input-mask-date').mask('9999/99/99');
    //});

    var vm = new Vue(
        {
            el: "#app",
            data: {
                khblst: [],
                khbinfo: new KaoHeBiao(),
                gzcdrlist: [],
                khnrtow: new MyKaoHeBiaoTwo(),
                availableTags:[]
            },
            mounted() {
                this.initPage();
                },
            methods: {
                initPage: function() {
                    var _self = this;
                    $('.date-picker').datepicker({
                        language: "zh-CN",
                        autoclose: true,
                        format: "yyyy-mm",
                        minViewMode: 1
                    }).next().on(ace.click_event,
                        function() {
                            $(this).prev().focus();
                        });
                    $('.date-picker2').datepicker({
                        language: "zh-CN",
                        autoclose: true,
                        format: "yyyy-mm-dd"
                    }).next().on(ace.click_event,
                        function() {
                            $(this).prev().focus();
                        });
                    $('[data-rel=tooltip]').tooltip();
                    _self.p_Gets();
                    _self.p_getGongZuoChengDanRen();

                },
                getgzcdr() {
                    var _self = this;
                    console.log(_self.khnrtow.gzcdrid);
                    $(_self.gzcdrlist).each(function(i, item) {
                        if (_self.khnrtow.gzcdrid == item.userinfoId) {
                            _self.khnrtow.gzcdr = item.XingMing;
                            console.log(_self.khnrtow.gzcdr);
                        }
                    });
                },
                p_getGongZuoChengDanRen() {
                    ///<summary>获取工作承担人</summary>
                    var _self = this;
                    axios.post('@Url.Action("p_getGongZuoChengDanRen", "MyCaoZuo")', _self.khbinfo).then(
                            (response) => {
                            _self.availableTags = [];
                            _self.availableTags.push({ label: "我自己", value: "我自己", id: "@SiteInfo.UserId" });
                            $(response.data).each(function (i, item) {
                                _self.availableTags.push({ label: item.XingMing, value: item.XingMing, id: item.userinfoId });
                                });
                                //autocomplete
                            $("#tags").autocomplete({
                                source: _self.availableTags,
                                    select: function (event, ui) {
                                        _self.khnrtow.gzcdrid = ui.item.id;
                                        console.log(_self.khnrtow.gzcdrid);
                                    }
                            });
                            $("#tags").val("我自己");
                            _self.khnrtow.gzcdrid = "@SiteInfo.UserId";
                            },
                            (response) => {

                            }
                        )
                        .catch(
                            function(error) {
                                bootbox.alert(error);
                                //alert(error);
                            }
                        );
                },
                p_OpenModal: function(e) {
                    var _self = this;
                    e.preventDefault();
                    var dialog = dialog_comm(true,
                        "dialog-message",
                        "创建工作计划",
                        null,
                        function() { _self.p_Create(); },
                        true);
                },
                p_OpenEditMessage: function(f, s) { //打开编辑任务对话框
                    var _self = this;
                    $('#form-field-2').unbind('keyup');
                    //绑定事件
                    $('#form-field-2').bind('keyup', function () { _self.p_fzyanzheng(f)});
                    //e.preventDefault();
                    _self.khnrtow = new MyKaoHeBiaoTwo(s);
                    var dialog = dialog_comm(true,
                        "editmessage",
                        "编辑工作内容",
                        null,
                        function() { _self.p_Savetow(f) },
                        true,
                        '930');
                },
                p_fzyanzheng(f) {//分值验证
                    var self = this;
                    var yyfz = 0; //已经使用的分值
                    $(f.MyKaoHeBiaoTwos).each(function (i, item) {
                        if (item.twoid != self.khnrtow.twoid) {
                            yyfz = parseInt(yyfz) + parseInt(item.fz);
                        }
                    });
                    yyfz = parseInt(yyfz) + parseInt(self.khnrtow.fz);
                    if (parseInt(yyfz) > parseInt(f.fz)) {
                        //bootbox.alert(f.mbnr + "：分值设置超了");
                        alert(f.mbnr + "：分值设置超了");
                        self.khnrtow.fz = 0;
                        $("#form-field-2").select();
                    }
                },
                p_Savetow(f) { //保存单条信息
                    var self = this;
                    //TODO 添加一个分项，总项分值计算方式，不能超出总分
                    var self = this;
                    var yyfz = 0; //已经使用的分值
                    $(f.MyKaoHeBiaoTwos).each(function(i, item) {
                        if (item.twoid != self.khnrtow.twoid) {
                            yyfz = parseInt(yyfz) + parseInt(item.fz);
                        }
                    });
                    yyfz = parseInt(yyfz) + parseInt(self.khnrtow.fz);
                    if (parseInt(yyfz) > parseInt(f.fz)) {
                        alert(f.mbnr + "：分值设置超了");
                    } else {
                        self.khnrtow.gzjhwcsj = $("#date-picker2").val();
                        self.khnrtow.IsEdit = true;
                        var readyData = { model: self.khnrtow, mkhbid: self.khbinfo.mkhbid, oneid: f.oneid }
                        axios.post('@Url.Action("saveKaoHeNeiRongTow", "MyCaoZuo")', readyData).then(
                                (response) => {
                                    debugger;
                                self.khnrtow.twoid = response.data.id;
                                    self.khnrtow.gzcdr = "我自己";
                                $(self.availableTags).each(function(i, item) {
                                    if (item.id == self.khnrtow.gzcdrid) {
                                        self.khnrtow.gzcdr = item.label.split(":")[0];
                                            return false;
                                        }
                                    });
                                    var flag = true;
                                    $(f.MyKaoHeBiaoTwos).each(function(i, item) {
                                        if (item.xlid != "" && item.xlid == self.khnrtow.xlid) {
                                            flag = false;
                                            f.MyKaoHeBiaoTwos.splice(i, 1, new MyKaoHeBiaoTwo(self.khnrtow));
                                            return false;
                                        }
                                    });
                                    if (flag) {
                                        f.MyKaoHeBiaoTwos.push(self.khnrtow);
                                    }
                                },
                                (response) => {

                                }
                            )
                            .catch(
                                function (error) {
                                    bootbox.alert(error);
                                    //alert(error);
                                }
                            );
                    }

                },
                ShowInfo: function () {
                    $("#list").hide(function () {
                        $("#info").show();
                    });
                },
                ShowList: function () {
                    $("#info").hide(function () {
                        $("#list").show();
                    });
                },
                p_Edit: function (obj) {
                    var _self = this;
                    _self.p_Get(obj.mkhbid);
                    _self.ShowInfo();
                },
                p_Create: function () {
                    var _self = this;
                    var sssj = $("#sssj").val();
                    axios.get("@Url.Action("CreateMyKaoHeBiao", "MyCaoZuo")", { params: { sssj: sssj } }).then(
                        (response) => {
                            if (response.data.code <= 1) {
                                bootbox.alert("创建成功");
                            } else {
                                bootbox.alert(response.data.msg);
                            }
                            _self.p_Gets();
                        },
                        (response) => {

                        }
                    ).catch(function(response) {
                        console.log(response);
                    });
                },
                p_Del: function(khbid) {
                    var _self = this;
                    bootbox.confirm("你确定这个操作吗?",
                        function(result) {
                            if (result) {
                                axios.get("@Url.Action("DelMyKaoHeBiao", "MyCaoZuo")", { params: { khbid: khbid } })
                                    .then(
                                        (response) => {
                                            bootbox.alert("删除成功");
                                            _self.p_Gets();
                                        },
                                        (response) => {

                                        }
                                    ).catch(function(response) {
                                        console.log(response);
                                    });
                            }
                        });
                },
                p_Gets: function() {
                    var _self = this;
                    axios.get("@Url.Action("GetMyKaoHeBiaos", "MyCaoZuo")").then((response) => {
                        _self.khblst = [];
                            for (var i = 0; i < response.data.length; i++) {
                                _self.khblst.push(response.data[i]);
                            }
                        },
                        (response) => {

                        }
                    ).catch(function(response) {
                        console.log(response);
                    });
                },
                p_Get: function (khbid) {
                    var _self = this;
                    axios.get("@Url.Action("GetMyKaoHeBiaoInfo", "MyCaoZuo")", { params: { khbid: khbid } }).then((response) => {
                            _self.khbinfo=response.data;
                        },
                        (response) => {

                        }
                    ).catch(function(response) {
                        console.log(response);
                    });
                },
                p_DelTwo: function (f, obj) {
                    var _self = this;
                    bootbox.confirm("你确定这个操作吗?",
                        function(result) {
                            if (result) {
                                axios.get("@Url.Action("delKaoHeNeiRongTow", "MyCaoZuo")", { params: { towid: obj.twoid, mkhbid: _self.khbinfo.mkhbid, oneid: f.oneid } }).then((response) => {
                                    bootbox.alert("成功");
                                    var index = -1;
                                    $(f.MyKaoHeBiaoTwos).each(function(i, item) {
                                        if (item.twoid == obj.twoid) {
                                            index = i;
                                        }
                                    });
                                    if (index > -1) {
                                        f.MyKaoHeBiaoTwos.splice(index, 1);
                                    }
                                    },
                                    (response) => {

                                    }
                                ).catch(function(response) {
                                    console.log(response);
                                });
                            }
                        });

                    //var index = -1;
                    //$(pobj.MyKaoHeBiaoTwos).each(function(i,item) {
                    //    if (item.mbnr == obj.mbnr) {
                    //        index = i;
                    //    }
                    //});
                    //if (index > -1) {
                    //    pobj.MyKaoHeBiaoTwos.splice(index, 1);
                    //}
                },
                p_AddTwo: function (obj, son) {//新增操作
                    var model = new MyKaoHeBiaoTwo();
                    if (son) {
                        model.xiangguangongzuo.push(new xiangguangongzuo({ xggzid: son.towid, xggz: son.mbnr }));
                    }
                    this.p_OpenEditMessage(obj, model);
                    //obj.MyKaoHeBiaoTwos.push(new MyKaoHeBiaoTwo({ twoid: 0, mbid: 0, mbnr: "", fz: 0, sx: 0, htmlstr: "", zf: 0, gzjhkssj: "", gzjhkssjstr: "", gzbz: "", gzjhwcsj: "", gzjhwcsjstr: "", gzjhwcqk: "", bz: "", MyKaoHeBiaoTwoPingFens: [], IsEdit:true}));
                    //this.inputdatetimeformat();
                },
                p_EditTwo(f, s) {//编辑操作
                    var _self = this;
                    s.xlid = this.getGuid();
                    $("#date-picker2").val(s.gzjhwcsj);
                    $(_self.availableTags).each(function(i, item) {
                        if (item.id == s.gzcdrid) {
                            $("#tags").val(item.label);
                            return false;
                        }
                    });
                    this.p_OpenEditMessage(f,s);
                },
                p_Save: function() {
                    var _self = this;
                    axios.post('@Url.Action("UpdateMyKaoHeBiao", "MyCaoZuo")', _self.khbinfo).then(
                        (response) => {
                                bootbox.alert("成功",
                                    function (response) {
                                        _self.ShowList();
                                        _self.p_Gets();
                                    });
                        },
                        (response) => {

                        }
                        )
                        .catch(
                        function (error) {
                            bootbox.alert(error);
                            //alert(error);
                        }
                        );
                },
                p_TiJiaoShenHe: function(khbid) {
                    var _self = this;
                    bootbox.confirm("你确定这个操作吗?",
                        function(result) {
                            if (result) {
                                axios.get("@Url.Action("UpdateTiJiaoMyKaoHeBiao", "MyCaoZuo")", { params: { khbid: khbid } }).then((response) => {
                                    if (response) {
                                        if (response.data.error) {
                                            bootbox.alert(response.data.data);
                                        } else {
                                            bootbox.alert("提交成功");
                                            _self.p_Gets();
                                        }
                                    }
                                    },
                                    (response) => {
                                        bootbox.alert("填写有误或分值不合适，请重新核对");
                                    }
                                ).catch(function(response) {
                                    console.log(response);
                                });
                            }
                        });
                },
                inputdatetimeformat: function (event) {
                    var el = event.currentTarget;
                    $(el).mask('9999-99-99');
                },
                dateformat: function (event, obj) {
                    var el = event.currentTarget;
                    var index=-1;
                    index = $(el).val().indexOf("_");
                    if(index==-1) {
                        obj.gzjhkssjstr = $(el).val();
                    }

                },
                getGuid() {
                    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
                        var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
                        return v.toString(16);
                    });
                }
            }
        });
</script>